package com.dao;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class Hibernateutill {
	private static final SessionFactory sessionFactory = buildSessionfactory();
	private static SessionFactory buildSessionfactory(){
		try {
			return new AnnotationConfiguration().configure().buildSessionFactory();
			
		} catch (Throwable e) {
			System.err.print("Error" + e);
			throw new ExceptionInInitializerError(e);
			// TODO: handle exception
		}
	}
	public static SessionFactory getSessionFactory(){
		return sessionFactory;
	}
}
